import request from '@/utils/request'

export function getCategoryNameByCategoryId(id) {
  return request({
    url: `/api/goods/category/getCategoryNameByCategoryId/${id}`,
    method: 'get'
  })
}

export function list() {
  return request({
    url: '/api/goods/category/list/tree',
    method: 'get'
  })
}

export function add(list) {
  return request({
    url: '/api/goods/category/save',
    method: 'post',
    data: list
  })
}

export function delMultiple(ids) {
  return request({
    url: '/api/goods/category/delete',
    method: 'post',
    data: ids
  })
}

export function update(list) {
  return request({
    url: '/api/goods/category/update',
    method: 'post',
    data: list
  })
}

export function updateSort(list) {
  return request({
    url: '/api/goods/category/update/sort',
    method: 'post',
    data: list
  })
}
